package cn.yujiago.miaosha.controller;

import cn.yujiago.miaosha.dto.Result;
import cn.yujiago.miaosha.entity.User;
import cn.yujiago.miaosha.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/user/login")
    @ResponseBody
    public Result login(HttpServletResponse response, User user){
        return userService.login(response, user);
    }

}
